<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" xmlns:tang="">
<head>
    <meta charset="UTF-8"/>
    <title>role list</title>
    <link rel="stylesheet" th:href="@{/css/css.css}">
</head>
<body>
<div class="message" th:text="${msg}" th:if="${msg!=null}"></div>
<shiro:hasPermission name="user:create">
<a th:href="@{/user/create}">用户新增</a><br/>
</shiro:hasPermission>
<table class="table">
    <thead>
    <tr>
        <th>用户名</th>
        <th>所属组织</th>
        <th>角色列表</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="user:${userList}">

        <td th:text="${user.username}"></td>
        <td tang:replace_string="organization_list:${user.organizationId}"></td>
        <td tang:replace_string="role_list:${user.roleIds}"></td>

        <td>
            <shiro:hasPermission name="user:update">
                <a th:href="'/user/'+${user.id}+'/update'">修改</a>
            </shiro:hasPermission>
            <shiro:hasPermission name="user:delete">
                <a th:href="'/user/'+${user.id}+'/delete'">删除</a>
            </shiro:hasPermission>
            <shiro:hasPermission name="user:update">
                <a th:href="'/user/'+${user.id}+'/changePassword'">改密</a>
            </shiro:hasPermission>
        </td>

    </tr>
    </tbody>
</table>
</body>
</html>